/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.commodity.service;

import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Page;

import com.wealth.commodity.entity.Comment;

import iaas.service.IBaseService;
import iaas.utils.ResultObject;
import iaas.web.JqGridRequest;

/**
 * @author chan
 * @version 1.0
 * @since 1.0
 */
 
public interface ICommentService extends IBaseService<Comment>{
	
	public Page<Comment> get(Long corpid, Long merchantId, JqGridRequest request,Class<Comment> comment);
	
	/** 发表评论 */
	public ResultObject saveComment(Comment comment);
	/** 发表评论 */
	public ResultObject saveCommentPc(Comment comment,Long orderItemId);
	
	
	
	/** 加载商户评价 */
	public List<Comment> ajaxCommentByMerchantId(Long merchantid, Integer index,Integer offset) throws Exception;
	
	/** 商户最近的评论  前offset条  */
	public List<Comment>  getLatestCommentByMerchantId(Long merchantid,Integer offset) throws Exception;
	
	/** 商户评价平均分数  */
	public Integer getAvgScoreByMerchantId(Long merchantid) throws Exception;
	
	/** 商户评价总数 */
	public Integer getCommentNumByMerchantId(Long merchantid) throws Exception;
	
	
	
	/** 加载商品评价 */
	public List<Comment> ajaxComment(Long goodsid, Integer index,Integer offset) throws Exception;
	
	/** 商品最近的评论  前offset条  */
	public List<Comment>  getLatestComment(Long goodsid,Integer offset) throws Exception;
	
	/** 商品评价平均分数  */
	public Integer getAvgScore(Long goodsid) throws Exception;
	
	/** 商品评价总数 */
	public Integer getCommentNum(Long goodsid) throws Exception;
	
	//PC端分页查询商品评价
	public Map<String,Object>  getComment(int pageNumber, int pageSize,
			String sortType,String sortDirection,Long goodsId);
	
	
}

